<?php 
require '../../frame/base.php';

$sid = !empty($_REQUEST['sid']) ? $_REQUEST['sid'] : null;
$uid = !empty($_REQUEST['uid']) ? $_REQUEST['uid'] : null;


// 分页
if($_REQUEST['page']!="" && $_REQUEST['page']!= null && $_REQUEST['pagesize']!="" && $_REQUEST['pagesize'] != null){
	$de=$_REQUEST['page']*$_REQUEST['pagesize'];
	$size=$_REQUEST['pagesize'];
}else{
	$de=0;
	$size=20;
}
// 分页 end

if($sid){
	$data=$Db->table('present')->join('banks','banks.id = present.account_bank','LEFT')->where('sid',$sid)->limit($de,$size)->select();
}
if($uid){
	$data=$Db->table('present')->join('banks','banks.id = present.account_bank','LEFT')->where('uid',$uid)->limit($de,$size)->select();
	echo $Db->table('present')->getLastSql();
}
echo json_encode(['code'=>200,'msg'=>'成功','data'=>$data]);